<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

$this->title = '实名认证';
$this->params['breadcrumbs'][] = $this->title;
?>

            <div class="rwidt">
                <div class="rigtable">
                    <h3 class="grh3tit">实名认证</h3>
                    <div class="rwform pl15 pr15">
                    <h4 class="twodlcontitle">           
                       
                    </h4>
                       <form action="<?= yii\helpers\Url::to(['member/updatenameauth']);?>" method="post" enctype="multipart/form-data" onsubmit="return isCardNo();">
                       <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
                        <div>
                                    真实姓名：
                                    <input id="realname" type="text" name="realname" value="<?= $member->realname ?>"/>
                                    
                        </div>
						<p>
                        <div>
                                    身份证号：
                                    <input id="card" type="text" name="card" value="<?= $member->card ?>"/><br/>
                                    
                        </div>
						<p>
                        <div>
                                   身份证正面：
                                    <input id="cardz" type="file" name="cardz" value="<?= $member->cardz ?>"/><br/>
                                    
                        </div>
						<p>
                        <div>
                                    身份证反面：
                                    <input id="cardf" type="file" name="cardf" value="<?= $member->cardf ?>"/>
                                    
                        </div>
						<p>
                       <div class="action">
                                <div class="clearFloat">
                                    <div class="yzmsub floatLeft">
                                        <input type="submit" value="提交" class="yzmsubinput"/>
                                    </div>
                                </div>
                        </div>
                        </form>
                    </div>
                </div>
				<script>
				function isCardNo() {
					var realname = $("#realname").val();
					if(realname==''){
						alert("真实姓名不能为空！");
						return false
					}
				   var card = $("#card").val();
				   var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;  
				   if(pattern.test(card)){
					   return true;
				   }else{
					   alert("身份证号不对！");
					   return false;
				   }
				} 
				</script>
            </div>

        